package com.itjiange.common;

import lombok.Data;

/**
 * 响应结果类
 *
 * @author ItJiange
 * @date 2023/10/28
 */
@Data
public class BaseResponse<T> {
    private int code;
    private String message;
    private T data;

    public BaseResponse() {
    }

    public BaseResponse(ErrorCode errorCode) {
        this(errorCode.getCode(), errorCode.getMessage());
    }
    public BaseResponse(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public BaseResponse(int code, T data) {
        this.code = code;
        this.data = data;
    }

    public BaseResponse(int code, String message, T data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }
}
